<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .bookcls{
            background-color: pink;
        }

    </style>
</head>
<body>
    <div id="app">
        <book class="bookcls" a="b" author="罗贯中" :price="128" url="./imgs/1.jpg" ></book>        
    </div>
</body>
</html>
<script src="./js/vue.js"></script>
<script>

    // 书籍详情：
    let book = {
        props:{
            "url":{
                type:String,
                required:true
            },
            "name":{
                type:String,
                default:"西游记"
            },
            "author":String,
            "price":Number
        },
        template:`
            <div>
                <img :src="url" style="width:200px;height:200px">
                <p>名字：{{name}}</p>
                <p>作者：{{author}}</p>
                <p>价格：{{price}}</p>
            </div>
        `,
        
        data(){
            return {   

            }
        }        
    }   


    let vm = new Vue({
        el:"#app",
        components:{
            book
        },
        data:{
        }
        
    });


</script>